<%--
  Created by IntelliJ IDEA.
  User: xianfei
  Date: 15-6-4
  Time: 上午9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>短信功能</title>
    <script>
        $(function () {
            $("#send").click(function () {
                var customerType = $("[id^=customerType]:checked").val();
                if (customerType === "customer") {
                    var phoneNum = $("#cPhoneNum").val();
                    var cust_product = $("#cust_product").val();
                    var cust_paid = $("#cust_paid").val();
                    var cust_surplus = $("#cust_surplus").val();
                    var cust_address = $("#cust_address").val();
                    $.ajax({
                        url: '/msg/customer',
                        type: 'POST',
                        dataType: 'text',
                        data: {phoneNum: phoneNum, custProduct: cust_product, custPaid: cust_paid, custSurplus: cust_surplus, custAddress: cust_address},
                        success: function (data) {
                            alert(data);
                        }, error: function () {
                            alert('error');
                        }
                    })
                } else if (customerType === "service") {
                    var phoneNum = $("#sPhoneNum").val();
                    var service_customerName = $("#service_customerName").val();
                    var gender = $("[id^=gender]:checked").val();
                    var service_product = $("#service_product").val();
                    var service_paid = $("#service_paid").val();
                    var service_customerTel = $("#service_customerTel").val();
                    $.ajax({
                        url: '/msg/service',
                        type: 'POST',
                        dataType: 'text',
                        data: {phoneNum: phoneNum, serviceCustomerName: service_customerName, gender: gender, serviceProduct: service_product, servicePaid: service_paid, serviceCustomerTel: service_customerTel},
                        success: function (data) {
                            alert(data);
                        }, error: function () {
                            alert("error");
                        }
                    })
                } else {
                    alert("请选择类型!");
                }
            })
        })

        function firstModel() {

        }

        function secondModel() {

        }
    </script>
</head>
<body>
<div class="main">
    <!--客户-->
    <div class="customer">
        <div>
            <a href="javascript:firstModel()">模版一</a>
            <a href="javascript:secondModel()">模版二</a>
        </div>
        <div id="firstModel">
            <span>尊敬的客户，您购买的漫庭度假屋xxx产品已成功支付xxx。我们将会在七个工作日内与您预约签约，地址：xxx。请您保持手机畅通。详询：400-831-3336【漫庭网】</span>
            <div>
                <ul>
                    <li>购买产品</li>
                    <li>购买周次</li>
                    <li>已付金额</li>
                    <li>联系地址</li>
                </ul>
            </div>
            <div>
                <input type="text" class="form-control input-lg" id="first_product"/>
                <input type="text" class="form-control input-lg" id="first_week"/>
                <input type="text" class="form-control input-lg" id="first_paid"/>
                <input type="text" class="form-control input-lg" id="first_address"/>
            </div>
        </div>
        <div id="secondModel">
            <span>尊敬的客户，您购买的漫庭度假屋xxx产品已成功支付xxx。请您于一周之内前往漫庭会员之家缴纳剩余款项xxx并签署合约，我们将会安排专人接待，地址：xxx。详询400-831-3336。【漫庭网】</span>

            <div>
                <ul>
                    <li>购买产品</li>
                    <li>购买周次</li>
                    <li>已付金额</li>
                    <li>剩余金额</li>
                    <li>联系地址</li>
                </ul>
            </div>
            <div>
                <input type="text" class="form-control input-lg" id="second_product"/>
                <input type="text" class="form-control input-lg" id="second_week"/>
                <input type="text" class="form-control input-lg" id="second_paid"/>
                <input type="text" class="form-control input-lg" id="second_not_pay"/>
                <input type="text" class="form-control input-lg" id="second_address"/>
            </div>
        </div>
    </div>
    <!--提交-->
    <div class="send">
        <input class="btn btn-info" type="button" id="send" value="发送"/>
    </div>
</div>
</body>
</html>